package com.sfzd5.exam.helplibrary.exam;

import java.awt.*;
import java.awt.geom.Rectangle2D;

public class FontMetricsMM {
    FontMetrics fm;
    Graphics2D g;
    public FontMetricsMM(FontMetrics fm, Graphics2D g) {
        this.fm = fm;
        this.g = g;
    }

    public float getWidth(String str){
        Rectangle2D rc = fm.getStringBounds(str, g);
        return PageA4.point2mm((float) rc.getWidth());
    }
}
